import request from '@/utils/request'


export function addUser(user) {
    return request({
        url: '/user/addUser',
        method: 'post',
        data: user
    })
}

// 用户列表
export function getUserList() {
    return request({
        url: '/user/list',
        method: 'get',
    })
}

export function deleteByUserId(userId) {
    return request({
        url: `/user/${userId}`,
        method: 'delete',
    })
}

export function getByUserId(userId) {
    return request({
        url: `/user/${userId}`,
        method: 'get',
    })
}

// 修改用户
export function updateUser(user) {
    return request({
        url: '/user/updateUser',
        method: 'put',
        data: user
    })
}
